package com.management.service;

import com.management.po.Materials;
import com.management.po.MaterialsRecord;
import com.management.vo.MaterialsVO;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

/**
 * @version v1.0
 * @Author: Slark
 * @Date: Created in2021/11/1  9:48
 * 物品库存表业务逻辑测试类
 */
public class MaterialsServiceImpl {
    MaterialsService materialsService;
    @Before
    public  void common(){
        ApplicationContext context = new ClassPathXmlApplicationContext("spring/*.xml");
        materialsService = context.getBean(MaterialsService.class);
    }
    @Test
    public void findAll(){
        List<MaterialsVO> list = materialsService.findAll();
        if(list !=null){
            for (MaterialsVO m:list) {
                System.out.println(m);
            }
        }
    }
    @Test
    public void main2(){
        MaterialsVO list=materialsService.findByMaterialsId(2);
        System.out.println(list);
    }
    @Test
    public void main3(){
        List<MaterialsVO> list=materialsService.findByCompanyId(3);
        System.out.println(list);

    }
    @Test
    public void main4(){
        List<Materials> list=materialsService.findByMaterialsTypeId(2);
        System.out.println(list);
    }
    @Test
    public void main5(){
        List<Materials> list=materialsService.findByWarehouseId(2);
        System.out.println(list);
    }
    @Test
    public void main6(){
        List<Materials> list=materialsService.findByMaterialsUnitId(2);
        System.out.println(list);
    }
}
